<?php
//我的提案

function xitong_default(){
    xitong_page();
}
function xitong_page(){
    _output_template(0,'xitong');
}

function _zhengxie_outputXitong(){
    $str="  
            <div style='overflow: auto;border-radius: 10px;height: 93%;background-color: white;-webkit-box-shadow: #e2f0fe 0px 0px 10px;-moz-box-shadow: #e2f0fe 0px 0px 10px;box-shadow: #e2f0fe 0px 0px 10px;padding-top: 25px'>
                <div style='height: 48px; padding-left: 30px;width: 300px'>";
    if (empty($_REQUEST['manager'])){
        $manager = '1';
    }else{
        $manager = $_REQUEST['manager'];
    }

    if ($manager === '1'){
        $str.="<a href='?action=xitong&page=1&manager=1'><div class='system_role' style='width: 120px;height: 48px;background: #4e99ff;float: left;border-top-left-radius: 3px; border-top-right-radius: 3px;text-align: center;color: white;font-size: 16px'>角色权限</div></a>
               <a href='?action=xitong&page=1&manager=2'><div class='system_user' style='width: 120px;height: 48px;background: #f7f8f9;float: left;border-top-left-radius: 3px; border-top-right-radius: 3px;text-align: center;color: #999999;font-size: 16px'>用户管理</div></a>
               <div style='clear: both;'></div>
               </div>";

        $str.="    <div style='height:3px;background:#f7f8f9;'></div>
                
               <div class='solide_box' style='margin-top: 40px;width: 100%;padding-left: 25px;padding-right: 25px;'>
                   <span>身份管理权限</span>
                   <button onclick='showdialog();' style='cursor: pointer;float: right;position: relative;top:7px;font-size: 16px;color: white;background-color: #ffba4a;border-radius: 3px;width: 120px;height: 35px;border: none'>+新建</button>
               </div>
                
               <div class='solide_box' style='margin-top: 40px;width: 100%;padding-left: 25px;padding-right: 25px'>
                   <div style='width: 100%;height: 50px;background-color: #f2f7fe;border-left: 1px solid #1333;border-right: 1px solid #0333;border-top: 1px solid #0333;text-align: center;font-size: 15px'>
                       <div style='font-size: 16px;width: 10%;height: 100%;float: left;color: #3e8ffe;'>序号</div>
                       <div style='font-size: 16px;width: 10%;height: 100%;float: left;color: #3e8ffe;border-left: 1px solid #1333'>角色</div>
                       <div style='font-size: 16px;width: 39.3%;height: 100%;float: left;color: #3e8ffe;border-left: 1px solid #1333'>角色描述</div>
                       <div style='font-size: 16px;width: 10%;height: 100%;float: left;color: #3e8ffe;border-left: 1px solid #1333'>成员数</div>
                       <div style='font-size: 16px;width: 10%;height: 100%;float: left;color: #3e8ffe;border-left: 1px solid #1333'>创建时间</div>
                       <div style='font-size: 16px;width: 10%;height: 100%;float: left;color: #3e8ffe;border-left: 1px solid #1333'>创建人</div>
                       <div style='font-size: 16px;width: 10%;height: 100%;float: left;color: #3e8ffe;border-left: 1px solid #1333'>操作</div>
                       <div style='border: 0px;clear: both'></div>
                   </div>";

        //拼接
        $userGroup = getAllUserGroup();

        $i=0;
        foreach ($userGroup as $value){
            $i++;
            $count = array();
            $sql = "select count(*) as num from user where role=".$value['id'];
            $result = $GLOBALS['DB']->query($sql);
            while($res=$result->fetch()) {
                $count = $res;
            }
            if ($i === count($userGroup)){
                $str.="<div style='overflow: hidden;width: 100%;height: 50px;background-color: white;border: 1px solid #0333;text-align: center;font-size: 15px'>
                       <div style='overflow: hidden;width: 10%;height: 100%;float: left;color: #333;'>".$value['id']."</div>
                       <div style='overflow: hidden;width: 10%;height: 100%;float: left;color: #333;border-left: 1px solid #1333'>".$value['role']."</div>
                       <div style='overflow: hidden;width: 39.3%;height: 100%;float: left;color: #333;border-left: 1px solid #1333'>".$value['description']."</div>
                       <div style='overflow: hidden;width: 10%;height: 100%;float: left;color: #333;border-left: 1px solid #1333'>".$count['num']."</div>
                       <div style='overflow: hidden;width: 10%;height: 100%;float: left;color: #333;border-left: 1px solid #1333'>".$value['createtime']."</div>
                       <div style='overflow: hidden;width: 10%;height: 100%;float: left;color: #333;border-left: 1px solid #1333'>".$value['createuser']."</div>
                       <a href='?action=xitong&chakan=xitong&usergroupid=".$value['id']."'><div style='width: 10%;height: 100%;float: left;color:#3e9ffe;border-left: 1px solid #1333'>修改</div></a>
                       <div style='border: 0px;clear: both'></div>
                   </div>";
            }else if ($i === 1){
                $str.="<div style='overflow: hidden;width: 100%;height: 50px;background-color: white;border-left: 1px solid #1333;border-right: 1px solid #0333;border-top: 1px solid #0333;text-align: center;font-size: 15px'>
                       <div style='overflow: hidden;width: 10%;height: 100%;float: left;color: #333;'>".$value['id']."</div>
                       <div style='overflow: hidden;width: 10%;height: 100%;float: left;color: #333;border-left: 1px solid #1333'>".$value['role']."</div>
                       <div style='overflow: hidden;width: 39.3%;height: 100%;float: left;color: #333;border-left: 1px solid #1333'>".$value['description']."</div>
                       <div style='overflow: hidden;width: 10%;height: 100%;float: left;color: #333;border-left: 1px solid #1333'>".$count['num']."</div>
                       <div style='overflow: hidden;width: 10%;height: 100%;float: left;color: #333;border-left: 1px solid #1333'>".$value['createtime']."</div>
                       <div style='overflow: hidden;width: 10%;height: 100%;float: left;color: #333;border-left: 1px solid #1333'>".$value['createuser']."</div>
                       <div style='width: 10%;height: 100%;float: left;color:#3e9ffe;border-left: 1px solid #1333'></div>
                       <div style='border: 0px;clear: both'></div>
                   </div>";
            }else{
                $str.="<div style='overflow: hidden;width: 100%;height: 50px;background-color: white;border-left: 1px solid #1333;border-right: 1px solid #0333;border-top: 1px solid #0333;text-align: center;font-size: 15px'>
                       <div style='overflow: hidden;width: 10%;height: 100%;float: left;color: #333;'>".$value['id']."</div>
                       <div style='overflow: hidden;width: 10%;height: 100%;float: left;color: #333;border-left: 1px solid #1333'>".$value['role']."</div>
                       <div style='overflow: hidden;width: 39.3%;height: 100%;float: left;color: #333;border-left: 1px solid #1333'>".$value['description']."</div>
                       <div style='overflow: hidden;width: 10%;height: 100%;float: left;color: #333;border-left: 1px solid #1333'>".$count['num']."</div>
                       <div style='overflow: hidden;width: 10%;height: 100%;float: left;color: #333;border-left: 1px solid #1333'>".$value['createtime']."</div>
                       <div style='overflow: hidden;width: 10%;height: 100%;float: left;color: #333;border-left: 1px solid #1333'>".$value['createuser']."</div>
                       <a href='?action=xitong&chakan=xitong&usergroupid=".$value['id']."'><div style='width: 10%;height: 100%;float: left;color:#3e9ffe;border-left: 1px solid #1333'>修改</div></a>
                       <div style='border: 0px;clear: both'></div>
                   </div>";
            }
        }

        $str.="</div>";

    }else{

        $group = getAllUserGroup();

        if (!empty($_REQUEST['select_role'])){
            $select_role = $_REQUEST['select_role'];
            foreach ($group as $value){
                if ($value['role'] == $select_role){
                    $roleid = $value['id'];
                }
            }
        }

        if (!empty($_REQUEST['select_jc'])){
            $select_jc = $_REQUEST['select_jc'];
        }

        if (!empty($_REQUEST['searchName'])){
            $searchName = $_REQUEST['searchName'];
        }

        if (!empty($_REQUEST['searchPhone'])){
            $searchPhone = $_REQUEST['searchPhone'];
        }





        $str.="<a href='?action=xitong&page=1&manager=1'><div class='system_role' style='width: 120px;height: 48px;background: #f7f8f9;float: left;border-top-left-radius: 3px; border-top-right-radius: 3px;text-align: center;color: #999999;font-size: 15px'>角色权限</div></a>
               <a href='?action=xitong&page=1&manager=2'><div class='system_user' style='width: 120px;height: 48px;background: #4e99ff;float: left;border-top-left-radius: 3px; border-top-right-radius: 3px;text-align: center;color: white;font-size: 15px'>用户管理</div></a>
               <div style='clear: both;'></div>
               </div>
               <div style='height:3px;background:#f7f8f9;'></div>";



        /**
         * id 主键用户id
        username 用户名
        password 密码
        role 角色(1:超级管理员2:政协委员3:提案委员会
        4:交办单位 5:办理单位)
        photourl 头像地址
        realname 真实姓名
        sex 性别 (1:男2:女3:保密)
        session 届次
        age 年龄
        party 党派团体
        work 工作单位
        phone 电话号码
        street 所属街道工委
        createtime 创建时间
         */

        if (isset($select_role)){
            $sql = "select a.*,b.role from user as a left join usergroup as b on a.role=b.id where "
                .(isset($select_role)? "a.role='".$roleid."'":'')." "
                .(isset($select_jc)? "and a.session='".$select_jc."'":'')." "
                .(isset($searchName)? "and a.realname like '%".$searchName."%'":'')." "
                .(isset($searchPhone)? "and a.phone like '%".$searchPhone."%'":'');
        }else{
            if (isset($select_jc)){

                $sql = "select a.*,b.role from user as a left join usergroup as b on a.role=b.id where "
                    .(isset($select_jc)? "a.session='".$select_jc."'":'')." "
                    .(isset($select_role)? "and a.role='".$roleid."'":'')." "
                    .(isset($searchName)? "and a.realname like '%".$searchName."%'":'')." "
                    .(isset($searchPhone)? "and a.phone like '%".$searchPhone."%'":'');


            }else{
                if (isset($searchName)){


                    $sql = "select a.*,b.role from user as a left join usergroup as b on a.role=b.id where "
                        .(isset($searchName)? "a.realname like '%".$searchName."%'":'')." "
                        .(isset($select_jc)? "and a.session='".$select_jc."'":'')." "
                        .(isset($select_role)? "and a.role='".$roleid."'":'')." "
                        .(isset($searchPhone)? "and a.phone like '%".$searchPhone."%'":'');

                }else{
                    if (isset($searchPhone)){

                        $sql = "select a.*,b.role from user as a left join usergroup as b on a.role=b.id where "
                            .(isset($searchPhone)? "a.phone like '%".$searchPhone."%'":'')." "
                            .(isset($searchName)? "and a.realname like '%".$searchName."%'":'')." "
                            .(isset($select_jc)? "and a.session='".$select_jc."'":'')." "
                            .(isset($select_role)? "and a.role='".$roleid."'":'');

                    }else{
                        $user = getAllUserInfoOrGroupName();
                    }
                }
            }
        }

        error_log('组合后的sql:'.$sql);

        if (!empty($sql)){
            $user = array();
            $result = $GLOBALS['DB']->query($sql);
            while($res=$result->fetch()) {
                $user[] = $res;
            }
        }
        





        $str .= "<div class='solide_box' style='height: 60px ; width: 100%;padding-left: 30px;padding-right: 30px'>
                        
                        <div  class='box_1' style='width: 19%;float: left;height: 100%;display: inline-block;position: relative;'>
                            <span  class='select_role' style='position: relative;top: 50%;transform: translateY(-50%);'>".(isset($select_role)? $select_role:'请选择')."</span>
                            <ul class='sub_role'>";
                                foreach ($group as $value){
                                    $str.="<li>".$value['role']."</li>";
                                }
                        $str.="
                            </ul>
                            <style>
                                .sub_role{list-style-type:none;z-index: 1;}
                                .select_role{background-image: url('images/wode/sanjiao.png');background-repeat: no-repeat;background-position: 97%;font-size: 16px;color: #666;background-color: #fafdff;text-indent: 15px;border: 1px solid #f3f9fd;float: left;border-radius: 4px;width:100%;height:40px;cursor:pointer;line-height:40px;}
                                .sub_role{font-size: 16px;position: absolute;top: 50px;left: 0px;color:#e5e5e5;width:100%;background:#fafdff;border:1px solid #f3f9fd;display: none;}
                                .sub_role li{color: #666666;height:40px;text-align: center;line-height:40px;cursor:pointer;border-bottom:1px solid #f3f9fd;}
                                .sub_role li.hover{background:#8b8b8b;}
                            </style>
                            <script type='text/javascript'>
                                $('.box_1').click(function(event) {
                                    $('.sub_role').css('display') == 'none' ? $('.sub_role').css('display','block') : $('.sub_role').css('display','none');
                                });
                                
                                $('.sub_role li').each(function() {
                                    $(this).mouseover(function() {
                                        $(this).css('background-color','#429de3');
                                    });
                                    
                                    $(this).mouseout(function() {
                                        $(this).css('background-color','#fafdff');
                                    });
                                    
                                    $(this).click(function() {
                                        $('.sub_role').css('color','red')
                                        $('.select_role').html($(this).text());
                                    });
                                });
                            </script>
                        </div>
                        
                        <div class='box_2' style='width: 19%;float: left;margin-left: 1%;height: 100%;display: inline-block;position: relative;top: 50%;transform: translateY(-50%)'>
                            <span  class='select_jc' style='position: relative;top: 50%;transform: translateY(-50%);'>".(isset($select_jc)? $select_jc:'请选择')."</span>
                            <ul class='sub_jc'>
                                <li>12</li>
                                <li>13</li>
                                <li>14</li>
                                <li>15</li>
                                <li>16</li>
                                <li>17</li>
                                <li>18</li>
                                <li>19</li>
                                <li>20</li>
                            </ul>
                            <style>
                                .sub_jc{list-style-type:none;z-index: 1;}
                                .select_jc{background-image: url('images/wode/sanjiao.png');background-repeat: no-repeat;background-position: 97%;font-size: 16px;color: #666;background-color: #fafdff;text-indent: 15px;border: 1px solid #f3f9fd;float: left;border-radius: 4px;width:100%;height:40px;cursor:pointer;line-height:40px;}
                                .sub_jc{font-size: 16px;position: absolute;top: 50px;left: 0px;color:#e5e5e5;width:100%;background:#fafdff;border:1px solid #f3f9fd;display: none;}
                                .sub_jc li{color: #666666;height:40px;text-align: center;line-height:40px;cursor:pointer;border-bottom:1px solid #f3f9fd;}
                                .sub_jc li.hover{background:#8b8b8b;}
                            </style>
                            <script type='text/javascript'>
                                $('.box_2').click(function(event) {
                                    $('.sub_jc').css('display') == 'none' ? $('.sub_jc').css('display','block') : $('.sub_jc').css('display','none');
                                });
                                
                                $('.sub_jc li').each(function() {
                                    $(this).mouseover(function() {
                                        $(this).css('background-color','#429de3');
                                    });
                                    
                                    $(this).mouseout(function() {
                                        $(this).css('background-color','#fafdff');
                                    });
                                    
                                    $(this).click(function() {
                                        $('.sub_jc').css('color','red');
                                        $('.select_jc').html($(this).text());
                                    });
                                });
                            </script>
                        </div>
                        
                        <div style='width: 19%;float: left;margin-left: 1%;height: 100%;display: inline-block;position: relative;top: 50%;transform: translateY(-50%)'>
                            <input class='searchName' placeholder='姓名' value='".(isset($searchName)? $searchName:'')."' style='position: relative;top: 50%;transform: translateY(-50%);font-size: 16px;color: #666;text-indent: 15px;border: 1px solid #e5e5e5;float: left;border-radius: 4px;width:100%;height:40px;line-height:40px;'>
                        </div>
                        
                        <div style='width: 19%;float: left;margin-left: 1%;height: 100%;display: inline-block;position: relative;top: 50%;transform: translateY(-50%)'>
                            <input class='searchPhone' placeholder='手机号' value='".(isset($searchPhone)? $searchPhone:'')."' style='position: relative;top: 50%;transform: translateY(-50%);font-size: 16px;color: #666;text-indent: 15px;border: 1px solid #e5e5e5;float: left;border-radius: 4px;width:100%;height:40px;line-height:40px;'>
                        </div>
                        
                        <style>
                            .sub{list-style-type:none;}
                            .select{background-image: url(images/wode/sanjiao.png);background-repeat: no-repeat;background-position: 90%;font-size: 16px;color: #666;text-indent: 15px;border: 1px solid #e5e5e5;float: left;border-radius: 4px;width:100%;height:40px;cursor:pointer;line-height:40px;}
                            .sub{z-index: 1;font-size: 16px;position: absolute;color:#e5e5e5;background:#fff;border:1px solid #e5e5e5;display: none;width: 100%;top: 50px}
                            .sub li{color: #666666;height:40px;text-align: center;line-height:40px;cursor:pointer;border-bottom:1px solid #e5e5e5;}
                            .sub li.hover{background:#8b8b8b;}
                        </style>
                        
                        <div style='height: 54px;float: right;position: relative;top: 50%;transform: translateY(-50%);'>
                            <button onclick='searchUser();' style='cursor: pointer;font-size: 16px;color: white;border-radius: 5px;background-color: #42d79e;width: 76px;height: 41px;margin-right: 15px;margin-left: 15px;border: none'>查询</button>
                            <button onclick='clearSearchUser()' style='cursor: pointer;font-size: 16px;color: #42d79e;border-radius: 5px;border: 1px solid #42d79e;background-color: #fff;width: 76px;height: 41px;'>重置</button>
                        </div>
                 </div>";


        $str .= "<div class='solide_box' style='height: 60px ; width: 100%;padding-left: 30px;padding-right: 30px'>
                    <div style='height: 54px;float: left;position: relative;top: 50%;transform: translateY(-50%);'>
                        <button class='exportUserInfo' style='cursor: pointer;font-size: 16px;color: #3e8ffe;background-color: white;border-radius: 5px;border: 1px solid #3e8ffe;width: 76px;height: 40px;'>导出</button>
                    </div>
                    <a href='?action=xitong&manager=2&id=0'>
                    <button  style='cursor: pointer;float: right;position: relative;top:50%;transform: translateY(-50%); font-size: 16px;color: white;background-color: #ffba4a;border-radius: 3px;width: 120px;height: 40px;border: none'>+新建</button>
                    </a>
                 </div>";

        $str .= "<div class='solide_box' style='height: 700px;width: 100%;padding-left: 30px;padding-right: 30px'>
                    <div style='width: 100%;height: 50px;background-color: #f2f7fe;border-left: 1px solid #1333;border-right: 1px solid #0333;border-top: 1px solid #0333;text-align: center;font-size: 15px'>
                       <div style='font-size: 15px;width: 6%;height: 100%;float: left;color: #3e8ffe;'>序号</div>
                       <div style='font-size: 15px;width: 12%;height: 100%;float: left;color: #3e8ffe;border-left: 1px solid #1333'>唯一用户名</div>
                       <div style='font-size: 15px;width: 8.5%;height: 100%;float: left;color: #3e8ffe;border-left: 1px solid #1333'>姓名</div>
                       <div style='font-size: 15px;width: 4.5%;height: 100%;float: left;color: #3e8ffe;border-left: 1px solid #1333'>届次</div>
                       <div style='font-size: 15px;width: 4.5%;height: 100%;float: left;color: #3e8ffe;border-left: 1px solid #1333'>性别</div>
                       <div style='font-size: 15px;width: 4.5%;height: 100%;float: left;color: #3e8ffe;border-left: 1px solid #1333'>年龄</div>
                       <div style='font-size: 15px;width: 12.5%;height: 100%;float: left;color: #3e8ffe;border-left: 1px solid #1333'>党派团体</div>
                       <div style='font-size: 15px;width: 12%;height: 100%;float: left;color: #3e8ffe;border-left: 1px solid #1333'>工作单位</div>
                       <div style='font-size: 15px;width: 12%;height: 100%;float: left;color: #3e8ffe;border-left: 1px solid #1333'>手机号码</div>
                       <div style='font-size: 15px;width: 8.5%;height: 100%;float: left;color: #3e8ffe;border-left: 1px solid #1333'>街道工委</div>
                       <div style='font-size: 15px;width: 8.5%;height: 100%;float: left;color: #3e8ffe;border-left: 1px solid #1333'>所属角色</div>
                       <div style='font-size: 15px;width: 4.5%;height: 100%;float: left;color: #3e8ffe;border-left: 1px solid #1333'>操作</div>
                       <div style='border: 0px;clear: both'></div>
                    </div>
                 ";

        $j = 0;
        foreach ($user as $value){
            $j++;
            if ($j === count($user)){
                $str .= "<div style='width: 100%;height: 50px;background-color: white;border: 1px solid #0333;text-align: center;font-size: 15px'>";
            }else{
                $str .= "<div style='width: 100%;height: 50px;background-color: white;border-left: 1px solid #1333;border-right: 1px solid #0333;border-top: 1px solid #0333;text-align: center;font-size: 15px'>";
            }
                $str.="<div style='overflow: hidden;font-size: 15px;width: 6%;height: 100%;float: left;color: #333;'>".$j."</div>
                       <div style='overflow: hidden;font-size: 15px;width: 12%;height: 100%;float: left;color: #333;border-left: 1px solid #1333'>".$value['username']."</div>
                       <div style='overflow: hidden;font-size: 15px;width: 8.5%;height: 100%;float: left;color: #333;border-left: 1px solid #1333'>".$value['realname']."</div>
                       <div style='overflow: hidden;font-size: 15px;width: 4.5%;height: 100%;float: left;color: #333;border-left: 1px solid #1333'>".$value['session']."</div>
                       <div style='overflow: hidden;font-size: 15px;width: 4.5%;height: 100%;float: left;color: #333;border-left: 1px solid #1333'>".$value['sex']."</div>
                       <div style='overflow: hidden;font-size: 15px;width: 4.5%;height: 100%;float: left;color: #333;border-left: 1px solid #1333'>".$value['age']."</div>
                       <div style='overflow: hidden;font-size: 15px;width: 12.5%;height: 100%;float: left;color: #333;border-left: 1px solid #1333'>".$value['party']."</div>
                       <div style='overflow: hidden;font-size: 15px;width: 12%;height: 100%;float: left;color: #333;border-left: 1px solid #1333'>".$value['work']."</div>
                       <div style='overflow: hidden;font-size: 15px;width: 12%;height: 100%;float: left;color: #333;border-left: 1px solid #1333'>".$value['phone']."</div>
                       <div style='overflow: hidden;font-size: 15px;width: 8.5%;height: 100%;float: left;color: #333;border-left: 1px solid #1333'>".$value['street']."</div>
                       <div style='overflow: hidden;font-size: 15px;width: 8.5%;height: 100%;float: left;color: #333;border-left: 1px solid #1333'>".$value['role']."</div>
                       <a href='?action=xitong&manager=2&id=".$value['id']."'><div style='font-size: 15px;width: 4.5%;height: 100%;float: left;color: #3e9ffe;border-left: 1px solid #1333'>修改</div></a>
                       <div style='border: 0px;clear: both'></div>
                  </div>";
        }

        $str .= "</div>";
        $str.="<div class='solide_box' style='width: 100%;padding-left: 30px;padding-right: 30px;height: 80px'>".output_tab_2(count($user),1,2)."</div>";
    }

    $str.="</div>";
    return $str;
}


function zhengxie_outputXitongDialog(){
    if (!empty($_REQUEST['chakan'])){
        if ($_REQUEST['chakan'] == 'xitong' && !empty($_REQUEST['usergroupid'])){
            $sql = "select * from usergroup where id=".$_REQUEST['usergroupid'];
            $group = array();
            $result = $GLOBALS['DB']->query($sql);
            while($res=$result->fetch()) {
                $group = $res;
            }
            $str = '<script>showdialog();</script>';
            $str .= '<div style="width: 930px;height: 704px;margin-left: 210px;position: absolute;left: 43%;top: 15%;transform: translateX(-50%);">
                <div class="groupid_flag" id="'.$_REQUEST['usergroupid'].'" style="height: 82px;width: 100%;background-color: #3e8ffe;border-top-left-radius: 4px;border-top-right-radius: 4px;text-align: center;line-height: 82px;color: white;font-size: 19px;">
                    添加角色
                    <a onclick="dissmissdialog();" style="display: inline-block;width: 20px;height: 20px;position: absolute;right: 20px;top: -10px;"><div>X</div></a>
                </div>
                
                <div class="solide_box" style="height: 544px;width: 100%;background-color: white;padding-top: 30px;padding-left: 60px;padding-right: 60px;">
                    <div style="width: 100%;height: 50px;">
                        <div style="float: left;position: relative;top: 10px;font-size: 18px;line-height: 30px;color: #333333;width: 80px;display: inline-block">角色:</div>
                        <div style="margin-left: 85px;height: 50px">
                            <input class="role" type="text" value="'.$group['role'].'" style="font-size: 16px;background-color: #fafdff;border-radius: 4px;color: #666666;border: 1px solid #f3f9fd;margin-left: 10px;width: 100%;height: 40px;position: relative;top: 50%;transform: translateY(-50%);">
                        </div>
                        <!--<input type="text" style="font-size: 16px;background-color: #fafdff;border-radius: 4px;color: #666666;border: 1px solid #f3f9fd;margin-left: 10px;height: 40px;position: relative;top: 50%;transform: translateY(-50%);">-->
                    </div>
                    
                    <div style="width: 100%;color: #333333; font-size: 18px;margin-top: 30px;">
                        <div style="float: left;position: relative;top: 5px;font-size: 18px;line-height: 30px;color: #444444;width: 80px;display: inline-block">角色描述:</div>
                        <div style="margin-left: 85px;height: 90px">
                              <textarea class="description"  style="margin-left: 10px;overflow:auto;resize: none;;width: 100%;height: 104px; color: #666666;font-size: 16px;background-color: #fafdff;border: 1px solid #f1f5f9;">'.$group['description'].'</textarea>
                        </div>
                    </div>
                    
                    <div style="width: 100%;color: #333333; font-size: 18px;margin-top: 30px;">
                        <div style="float: left;position: relative;top: 5px;font-size: 18px;line-height: 30px;color: #444444;width: 80px;display: inline-block">权限配置:</div>
                        <div style="margin-left: 85px;height:30px"></div>
                    </div>
                    
                    <div style="width: 100%;color: #333333; font-size: 18px;margin-top: 10px;">
                        <script>
                            function isChecked(obj) {
                                var tmp = obj;
                                $(tmp).children("div").each(function(n) {
                                  if ($(this).attr("class") == "check"){
                                      $(this).css("display") == "none" ?  $(this).css("display","block") : $(this).css("display","none");
                                      
                                      if ($(this).css("display") == "none"){
                                          $("#checkAll").css("display","none");
                                      }else {
                                          var isCheckAll = true;
                                          $(".check").each(function(n) {
                                            if ($(this).css("display") == "none"){
                                                $("#checkAll").css("display","none");
                                                isCheckAll = false;
                                            }
                                          });  
                                          if (isCheckAll){
                                              $("#checkAll").css("display","block");
                                          }
                                      }
                                  };
                                });
                            }
                            
                            function isAllCheck(obj) {
                                var tmp = obj;
                                $(tmp).children("div").each(function(n) {
                                  if ($(this).attr("id") == "checkAll"){
                                      $(this).css("display") == "none" ?  $(this).css("display","block") : $(this).css("display","none");
                                      if ($(this).css("display") == "none"){
                                          $(".check").each(function(n) {
                                             $(this).css("display","none");
                                          });
                                      }else {
                                          $(".check").each(function(n) {
                                             $(this).css("display","block");
                                          });
                                      }
                                  }
                                });
                            }
                        </script>
                        <!-- 权限配置 -->
                        <!-- 登录 -->
                       ';
            //首页
            $str.='<div style="margin-left: 85px;height: 30px;margin-top: 20px">
                            <div style="width: 25%;height: 100%;float: left">
                                <div onclick="isAllCheck(this);" style="cursor:pointer;position: relative;display: inline-block">
                                    <div style="position:absolute;top: 3px;width: 18px;height: 18px;background-image: url(images/xitong/fang1.png)"></div>';
                                    if ($group['homepage'] == 0 ||
                                        $group['myproposal'] == 0 ||
                                        $group['createproposal'] == 0 ||
                                        $group['daifankuiproposal'] == 0 ||
                                        $group['shenchaproposal'] == 0 ||
                                        $group['jiaobanproposal'] == 0 ||
                                        $group['banliproposal'] == 0 ||
                                        $group['yibanproposal'] == 0 ||
                                        $group['suoyouproposal'] == 0 ||
                                        $group['weiyuaninfo'] == 0 ||
                                        $group['message'] == 0 ||
                                        $group['manager'] == 0){
                                        $str.='<div id="checkAll" style="position:absolute;top: 3px;display: none;width: 18px;height: 18px;background-image: url(images/xitong/fang2.png)"></div>';
                                    }else{
                                        $str.='<div id="checkAll" style="position:absolute;top: 3px;display: block;width: 18px;height: 18px;background-image: url(images/xitong/fang2.png)"></div>';
                                    }
                                    $str.='<span style="margin-left: 20px;font-size: 16px">全部</span>
                                </div>
                            </div>
                            <div style="width: 25%;height: 100%;float: left">
                                <div onclick="isChecked(this);" style="cursor:pointer;position: relative;display: inline-block">
                                    <div style="position:absolute;top: 3px;width: 17px;height: 17px;background-image: url(images/xitong/yuan1.png)"></div>
                                    ';
                                    $str.='<div class="check" style="position:absolute;top: 3px;'.($group['homepage'] == 0 ? 'display:none':'display:block').';width: 17px;height: 17px;background-image: url(images/xitong/yuan2.png)"></div>';
                                    $str.='
                                    <span style="margin-left: 20px;font-size: 16px">首页</span>
                                </div>
                            </div>
                            <div style="width: 25%;height: 100%;float: left">
                                <div onclick="isChecked(this);" style="cursor:pointer;position: relative;display: inline-block">
                                    <div style="position:absolute;top: 3px;width: 17px;height: 17px;background-image: url(images/xitong/yuan1.png)"></div>';
                                $str.='<div class="check" style="position:absolute;top: 3px;'.($group['myproposal'] == 0 ? 'display:none':'display:block').';width: 17px;height: 17px;background-image: url(images/xitong/yuan2.png)"></div>';
                                $str.='<span style="margin-left: 20px;font-size: 16px">我的提案</span>
                                </div>
                            </div>
                            <div style="width: 25%;height: 100%;float: left">
                                <div onclick="isChecked(this);" style="cursor:pointer;position: relative;display: inline-block">
                                    <div style="position:absolute;top: 3px;width: 17px;height: 17px;background-image: url(images/xitong/yuan1.png)"></div>';
                                $str.='<div class="check" style="position:absolute;top: 3px;'.($group['createproposal'] == 0 ? 'display:none':'display:block').';width: 17px;height: 17px;background-image: url(images/xitong/yuan2.png)"></div>';
                                $str.='<span style="margin-left: 20px;font-size: 16px">新建提案</span>
                                </div>
                            </div>
                        </div>
                        
                        <div style="margin-left: 85px;height: 30px;margin-top: 20px">
                            <div style="width: 25%;height: 100%;float: left">
                                
                            </div>
                            <div style="width: 25%;height: 100%;float: left">
                                <div onclick="isChecked(this);" style="cursor:pointer;position: relative;display: inline-block">
                                    <div style="position:absolute;top: 3px;width: 17px;height: 17px;background-image: url(images/xitong/yuan1.png)"></div>';
                                    $str.='<div class="check" style="position:absolute;top: 3px;'.($group['daifankuiproposal'] == 0 ? 'display:none':'display:block').';width: 17px;height: 17px;background-image: url(images/xitong/yuan2.png)"></div>';
                                    $str.='<span style="margin-left: 20px;font-size: 16px">待反馈提案</span>
                                </div>
                            </div>
                            <div style="width: 25%;height: 100%;float: left">
                                <div onclick="isChecked(this);" style="cursor:pointer;position: relative;display: inline-block">
                                    <div style="position:absolute;top: 3px;width: 17px;height: 17px;background-image: url(images/xitong/yuan1.png)"></div>';
                                $str.='<div class="check" style="position:absolute;top: 3px;'.($group['shenchaproposal'] == 0 ? 'display:none':'display:block').';width: 17px;height: 17px;background-image: url(images/xitong/yuan2.png)"></div>';
                                $str.='<span style="margin-left: 20px;font-size: 16px">审查提案</span>
                                </div>
                            </div>
                            <div style="width: 25%;height: 100%;float: left">
                                <div onclick="isChecked(this);" style="cursor:pointer;position: relative;display: inline-block">
                                    <div style="position:absolute;top: 3px;width: 17px;height: 17px;background-image: url(images/xitong/yuan1.png)"></div>';
            $str.='<div class="check" style="position:absolute;top: 3px;'.($group['jiaobanproposal'] == 0 ? 'display:none':'display:block').';width: 17px;height: 17px;background-image: url(images/xitong/yuan2.png)"></div>';
            $str.='<span style="margin-left: 20px;font-size: 16px">交办提案</span>
                                </div>
                            </div>
                        </div>';

            $str.='<div style="margin-left: 85px;height: 30px;margin-top: 20px">
                            <div style="width: 25%;height: 100%;float: left">
                                
                            </div>
                            <div style="width: 25%;height: 100%;float: left">
                                <div onclick="isChecked(this);" style="cursor:pointer;position: relative;display: inline-block">
                                    <div style="position:absolute;top: 3px;width: 17px;height: 17px;background-image: url(images/xitong/yuan1.png)"></div>';
            $str.='<div class="check" style="position:absolute;top: 3px;'.($group['banliproposal'] == 0 ? 'display:none':'display:block').';width: 17px;height: 17px;background-image: url(images/xitong/yuan2.png)"></div>';
            $str.='<span style="margin-left: 20px;font-size: 16px">办理提案</span>
                                </div>
                            </div>
                            <div style="width: 25%;height: 100%;float: left">
                                <div onclick="isChecked(this);" style="cursor:pointer;position: relative;display: inline-block">
                                    <div style="position:absolute;top: 3px;width: 17px;height: 17px;background-image: url(images/xitong/yuan1.png)"></div>';
            $str.='<div class="check" style="position:absolute;top: 3px;'.($group['yibanproposal'] == 0 ? 'display:none':'display:block').';width: 17px;height: 17px;background-image: url(images/xitong/yuan2.png)"></div>';
            $str.='<span style="margin-left: 20px;font-size: 16px">已办提案</span>
                                </div>
                            </div>
                            <div style="width: 25%;height: 100%;float: left">
                                <div onclick="isChecked(this);" style="cursor:pointer;position: relative;display: inline-block">
                                    <div style="position:absolute;top: 3px;width: 17px;height: 17px;background-image: url(images/xitong/yuan1.png)"></div>';
            $str.='<div class="check" style="position:absolute;top: 3px;'.($group['suoyouproposal'] == 0 ? 'display:none':'display:block').';width: 17px;height: 17px;background-image: url(images/xitong/yuan2.png)"></div>';
            $str.='<span style="margin-left: 20px;font-size: 16px">所有提案</span>
                                </div>
                            </div>
                        </div>
                        
                        <div style="margin-left: 85px;height: 30px;margin-top: 20px">
                            <div style="width: 25%;height: 100%;float: left">
                                
                            </div>
                            <div style="width: 25%;height: 100%;float: left">
                                <div onclick="isChecked(this);" style="cursor:pointer;position: relative;display: inline-block">
                                    <div style="position:absolute;top: 3px;width: 17px;height: 17px;background-image: url(images/xitong/yuan1.png)"></div>';
            $str.='<div class="check" style="position:absolute;top: 3px;'.($group['weiyuaninfo'] == 0 ? 'display:none':'display:block').';width: 17px;height: 17px;background-image: url(images/xitong/yuan2.png)"></div>';
            $str.='<span style="margin-left: 20px;font-size: 16px">委员信息</span>
                                </div>
                            </div>
                            <div style="width: 25%;height: 100%;float: left">
                                <div onclick="isChecked(this);" style="cursor:pointer;position: relative;display: inline-block">
                                    <div style="position:absolute;top: 3px;width: 17px;height: 17px;background-image: url(images/xitong/yuan1.png)"></div>';
            $str.='<div class="check" style="position:absolute;top: 3px;'.($group['message'] == 0 ? 'display:none':'display:block').';width: 17px;height: 17px;background-image: url(images/xitong/yuan2.png)"></div>';
            $str.='<span style="margin-left: 20px;font-size: 16px">消息中心</span>
                                </div>
                            </div>
                            <div style="width: 25%;height: 100%;float: left">
                                <div onclick="isChecked(this);" style="cursor:pointer;position: relative;display: inline-block">
                                    <div style="position:absolute;top: 3px;width: 17px;height: 17px;background-image: url(images/xitong/yuan1.png)"></div>';
            $str.='<div class="check" style="position:absolute;top: 3px;'.($group['manager'] == 0 ? 'display:none':'display:block').';width: 17px;height: 17px;background-image: url(images/xitong/yuan2.png)"></div>';
            $str.='<span style="margin-left: 20px;font-size: 16px">系统管理</span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                
                <div style="height: 78px;width: 100%;position: relative;background-color: #f0f6ff;border-bottom-left-radius: 4px;border-bottom-right-radius: 4px">
                    <div style=";display: inline-block;position: absolute;left: 50%;top: 18%;transform: translateX(-50%);">
                        <button onclick="dissmissdialog();"  style="background-color: transparent;width: 210px;height: 48px;border: 1px solid #3e8ffe;border-radius: 10px;color: #3e8ffe;font-size: 16px;">取消</button>
                        <button onclick="updateUserGroup();" style="background-color: #3e8ffe;width: 210px;height: 48px;border-radius: 10px;color: white;font-size: 16px;">确定</button>
                    </div>
                </div>
            </div>';
            return $str;
        }
    }

    if (!isset($_REQUEST['manager']) || $_REQUEST['manager'] == 1){
        $str = '<div style="width: 930px;height: 704px;margin-left: 210px;position: absolute;left: 43%;top: 15%;transform: translateX(-50%);">
                <div style="height: 82px;width: 100%;background-color: #3e8ffe;border-top-left-radius: 4px;border-top-right-radius: 4px;text-align: center;line-height: 82px;color: white;font-size: 19px;">
                    添加角色
                    <a onclick="dissmissdialog();" style="display: inline-block;width: 20px;height: 20px;position: absolute;right: 20px;top: -10px;"><div>X</div></a>
                </div>
                
                <div class="solide_box" style="height: 544px;width: 100%;background-color: white;padding-top: 30px;padding-left: 60px;padding-right: 60px;">
                    <div style="width: 100%;height: 50px;">
                        <div style="float: left;position: relative;top: 10px;font-size: 18px;line-height: 30px;color: #333333;width: 80px;display: inline-block">角色:</div>
                        <div style="margin-left: 85px;height: 50px">
                            <input class="role" type="text" style="font-size: 16px;background-color: #fafdff;border-radius: 4px;color: #666666;border: 1px solid #f3f9fd;margin-left: 10px;width: 100%;height: 40px;position: relative;top: 50%;transform: translateY(-50%);">
                        </div>
                        <!--<input type="text" style="font-size: 16px;background-color: #fafdff;border-radius: 4px;color: #666666;border: 1px solid #f3f9fd;margin-left: 10px;height: 40px;position: relative;top: 50%;transform: translateY(-50%);">-->
                    </div>
                    
                    <div style="width: 100%;color: #333333; font-size: 18px;margin-top: 30px;">
                        <div style="float: left;position: relative;top: 5px;font-size: 18px;line-height: 30px;color: #444444;width: 80px;display: inline-block">角色描述:</div>
                        <div style="margin-left: 85px;height: 90px">
                              <textarea class="description" style="margin-left: 10px;overflow:auto;resize: none;;width: 100%;height: 104px; color: #666666;font-size: 16px;background-color: #fafdff;border: 1px solid #f1f5f9;"></textarea>
                        </div>
                    </div>
                    
                    <div style="width: 100%;color: #333333; font-size: 18px;margin-top: 30px;">
                        <div style="float: left;position: relative;top: 5px;font-size: 18px;line-height: 30px;color: #444444;width: 80px;display: inline-block">权限配置:</div>
                        <div style="margin-left: 85px;height:30px"></div>
                    </div>
                    
                    <div style="width: 100%;color: #333333; font-size: 18px;margin-top: 10px;">
                        <script>
                            function isChecked(obj) {
                                var tmp = obj;
                                $(tmp).children("div").each(function(n) {
                                  if ($(this).attr("class") == "check"){
                                      $(this).css("display") == "none" ?  $(this).css("display","block") : $(this).css("display","none");
                                      
                                      if ($(this).css("display") == "none"){
                                          $("#checkAll").css("display","none");
                                      }else {
                                          var isCheckAll = true;
                                          $(".check").each(function(n) {
                                            if ($(this).css("display") == "none"){
                                                $("#checkAll").css("display","none");
                                                isCheckAll = false;
                                            }
                                          });
                                          if (isCheckAll){
                                              $("#checkAll").css("display","block");
                                          }
                                      }
                                  };
                                });
                            }
                            
                            function isAllCheck(obj) {
                                var tmp = obj;
                                $(tmp).children("div").each(function(n) {
                                  if ($(this).attr("id") == "checkAll"){
                                      $(this).css("display") == "none" ?  $(this).css("display","block") : $(this).css("display","none");
                                      if ($(this).css("display") == "none"){
                                          $(".check").each(function(n) {
                                             $(this).css("display","none");
                                          });
                                      }else {
                                          $(".check").each(function(n) {
                                             $(this).css("display","block");
                                          });
                                      }
                                  }
                                });
                            }
                        </script>
                        <!-- 权限配置 -->
                        <!-- 登录 -->
                       ';
        //首页
        $str.='        <div style="margin-left: 85px;height: 30px;margin-top: 20px">
                            <div style="width: 25%;height: 100%;float: left">
                                <div onclick="isAllCheck(this);" style="cursor:pointer;position: relative;display: inline-block">
                                    <div style="position:absolute;top: 3px;width: 18px;height: 18px;background-image: url(images/xitong/fang1.png)"></div>
                                    <div id="checkAll" style="position:absolute;top: 3px;display: block;width: 18px;height: 18px;background-image: url(images/xitong/fang2.png)"></div>
                                    <span style="margin-left: 20px;font-size: 16px">全部</span>
                                </div>
                            </div>
                            <div style="width: 25%;height: 100%;float: left">
                                <div onclick="isChecked(this);" style="cursor:pointer;position: relative;display: inline-block">
                                    <div style="position:absolute;top: 3px;width: 17px;height: 17px;background-image: url(images/xitong/yuan1.png)"></div>
                                    <div class="check" style="position:absolute;top: 3px;display: block;width: 17px;height: 17px;background-image: url(images/xitong/yuan2.png)"></div>
                                    <span style="margin-left: 20px;font-size: 16px">首页</span>
                                </div>
                            </div>
                            <div style="width: 25%;height: 100%;float: left">
                                <div onclick="isChecked(this);" style="cursor:pointer;position: relative;display: inline-block">
                                    <div style="position:absolute;top: 3px;width: 17px;height: 17px;background-image: url(images/xitong/yuan1.png)"></div>
                                    <div class="check" style="position:absolute;top: 3px;display: block;width: 17px;height: 17px;background-image: url(images/xitong/yuan2.png)"></div>
                                    <span style="margin-left: 20px;font-size: 16px">我的提案</span>
                                </div>
                            </div>
                            <div style="width: 25%;height: 100%;float: left">
                                <div onclick="isChecked(this);" style="cursor:pointer;position: relative;display: inline-block">
                                    <div style="position:absolute;top: 3px;width: 17px;height: 17px;background-image: url(images/xitong/yuan1.png)"></div>
                                    <div class="check" style="position:absolute;top: 3px;display: block;width: 17px;height: 17px;background-image: url(images/xitong/yuan2.png)"></div>
                                    <span style="margin-left: 20px;font-size: 16px">新建提案</span>
                                </div>
                            </div>
                        </div>
                        
                        <div style="margin-left: 85px;height: 30px;margin-top: 20px">
                            <div style="width: 25%;height: 100%;float: left">
                                
                            </div>
                            <div style="width: 25%;height: 100%;float: left">
                                <div onclick="isChecked(this);" style="cursor:pointer;position: relative;display: inline-block">
                                    <div style="position:absolute;top: 3px;width: 17px;height: 17px;background-image: url(images/xitong/yuan1.png)"></div>
                                    <div class="check" style="position:absolute;top: 3px;display: block;width: 17px;height: 17px;background-image: url(images/xitong/yuan2.png)"></div>
                                    <span style="margin-left: 20px;font-size: 16px">待反馈提案</span>
                                </div>
                            </div>
                            <div style="width: 25%;height: 100%;float: left">
                                <div onclick="isChecked(this);" style="cursor:pointer;position: relative;display: inline-block">
                                    <div style="position:absolute;top: 3px;width: 17px;height: 17px;background-image: url(images/xitong/yuan1.png)"></div>
                                    <div class="check" style="position:absolute;top: 3px;display: block;width: 17px;height: 17px;background-image: url(images/xitong/yuan2.png)"></div>
                                    <span style="margin-left: 20px;font-size: 16px">审查提案</span>
                                </div>
                            </div>
                            <div style="width: 25%;height: 100%;float: left">
                                <div onclick="isChecked(this);" style="cursor:pointer;position: relative;display: inline-block">
                                    <div style="position:absolute;top: 3px;width: 17px;height: 17px;background-image: url(images/xitong/yuan1.png)"></div>
                                    <div class="check" style="position:absolute;top: 3px;display: block;width: 17px;height: 17px;background-image: url(images/xitong/yuan2.png)"></div>
                                    <span style="margin-left: 20px;font-size: 16px">交办提案</span>
                                </div>
                            </div>
                        </div>';

        $str.='         <div style="margin-left: 85px;height: 30px;margin-top: 20px">
                            <div style="width: 25%;height: 100%;float: left">
                                
                            </div>
                            <div style="width: 25%;height: 100%;float: left">
                                <div onclick="isChecked(this);" style="cursor:pointer;position: relative;display: inline-block">
                                    <div style="position:absolute;top: 3px;width: 17px;height: 17px;background-image: url(images/xitong/yuan1.png)"></div>
                                    <div class="check" style="position:absolute;top: 3px;display: block;width: 17px;height: 17px;background-image: url(images/xitong/yuan2.png)"></div>
                                    <span style="margin-left: 20px;font-size: 16px">办理提案</span>
                                </div>
                            </div>
                            <div style="width: 25%;height: 100%;float: left">
                                <div onclick="isChecked(this);" style="cursor:pointer;position: relative;display: inline-block">
                                    <div style="position:absolute;top: 3px;width: 17px;height: 17px;background-image: url(images/xitong/yuan1.png)"></div>
                                    <div class="check" style="position:absolute;top: 3px;display: block;width: 17px;height: 17px;background-image: url(images/xitong/yuan2.png)"></div>
                                    <span style="margin-left: 20px;font-size: 16px">已办提案</span>
                                </div>
                            </div>
                            <div style="width: 25%;height: 100%;float: left">
                                <div onclick="isChecked(this);" style="cursor:pointer;position: relative;display: inline-block">
                                    <div style="position:absolute;top: 3px;width: 17px;height: 17px;background-image: url(images/xitong/yuan1.png)"></div>
                                    <div class="check" style="position:absolute;top: 3px;display: block;width: 17px;height: 17px;background-image: url(images/xitong/yuan2.png)"></div>
                                    <span style="margin-left: 20px;font-size: 16px">所有提案</span>
                                </div>
                            </div>
                        </div>
                        
                        <div style="margin-left: 85px;height: 30px;margin-top: 20px">
                            <div style="width: 25%;height: 100%;float: left">
                                
                            </div>
                            <div style="width: 25%;height: 100%;float: left">
                                <div onclick="isChecked(this);" style="cursor:pointer;position: relative;display: inline-block">
                                    <div style="position:absolute;top: 3px;width: 17px;height: 17px;background-image: url(images/xitong/yuan1.png)"></div>
                                    <div class="check" style="position:absolute;top: 3px;display: block;width: 17px;height: 17px;background-image: url(images/xitong/yuan2.png)"></div>
                                    <span style="margin-left: 20px;font-size: 16px">委员信息</span>
                                </div>
                            </div>
                            <div style="width: 25%;height: 100%;float: left">
                                <div onclick="isChecked(this);" style="cursor:pointer;position: relative;display: inline-block">
                                    <div style="position:absolute;top: 3px;width: 17px;height: 17px;background-image: url(images/xitong/yuan1.png)"></div>
                                    <div class="check" style="position:absolute;top: 3px;display: block;width: 17px;height: 17px;background-image: url(images/xitong/yuan2.png)"></div>
                                    <span style="margin-left: 20px;font-size: 16px">消息中心</span>
                                </div>
                            </div>
                            <div style="width: 25%;height: 100%;float: left">
                                <div onclick="isChecked(this);" style="cursor:pointer;position: relative;display: inline-block">
                                    <div style="position:absolute;top: 3px;width: 17px;height: 17px;background-image: url(images/xitong/yuan1.png)"></div>
                                    <div class="check" style="position:absolute;top: 3px;display: block;width: 17px;height: 17px;background-image: url(images/xitong/yuan2.png)"></div>
                                    <span style="margin-left: 20px;font-size: 16px">系统管理</span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                
                <div style="height: 78px;width: 100%;position: relative;background-color: #f0f6ff;border-bottom-left-radius: 4px;border-bottom-right-radius: 4px">
                    <div style=";display: inline-block;position: absolute;left: 50%;top: 18%;transform: translateX(-50%);">
                        <button onclick="dissmissdialog();"  style="background-color: transparent;width: 210px;height: 48px;border: 1px solid #3e8ffe;border-radius: 10px;color: #3e8ffe;font-size: 16px;">取消</button>
                        <button onclick="createUserGrounp();" style="background-color: #3e8ffe;width: 210px;height: 48px;border-radius: 10px;color: white;font-size: 16px;">确定</button>
                    </div>
                </div>
            </div>';
        return $str;
    }else{
        //空或者为2

        if (isset($_REQUEST['id'])){
            //弹出修改界面

            if ($_REQUEST['id'] != 0){
                $userdata = getUserInfo($_REQUEST['id']);
                $userGroupInfo = getUserGroupToId($userdata['role']);
            }
            $str='<script>showdialog();</script>';
        }else{
            $str='';
        }
        //用户管理

        $str .= '<div style="width: 930px;height: 704px;margin-left: 210px;position: absolute;left: 43%;top: 15%;transform: translateX(-50%);">
                <div style="height: 82px;width: 100%;background-color: #3e8ffe;border-top-left-radius: 4px;border-top-right-radius: 4px;text-align: center;line-height: 82px;color: white;font-size: 19px;">
                    用户信息
                    <a onclick="dissmissdialog();" style="display: inline-block;width: 20px;height: 20px;position: absolute;right: 20px;top: -10px;"><div>X</div></a>
                </div>
                <div class="solide_box" style="height: 544px;width: 100%;background-color: white;padding-top: 20px;padding-left: 60px;padding-right: 60px;">
                    <!--账号信息-->
                    <div style="font-size: 18px;color: #3e8ffe;">账号信息:</div>
                    <div style="width: 100%;height: 2px;margin-bottom: 10px;margin-top: 10px;background-color: #fff8ed"></div>
                    <div class="solide_box" style="width: 100%;padding-left: 20px;padding-right: 20px">
                        <div style="width: 47%;height: 50px;float: left">
                            <div style="float: left;position: relative;top: 10px;font-size: 16px;line-height: 30px;color: #333333;width: 80px;display: inline-block">登录名:</div>
                            <div style="margin-left: 85px;height: 50px">
                                <input class="dengluming" type="text" value="'.(!empty($userdata) == true ? $userdata['username'] : "").'" style="font-size: 16px;background-color: #fafdff;border-radius: 4px;color: #666666;border: 1px solid #f3f9fd;margin-left: 10px;width: 100%;height: 40px;position: relative;top: 50%;transform: translateY(-50%);">
                            </div>
                        </div>
                        
                        <div style="width: 47%;height: 50px;margin-left: 6%;float: left">
                            <div style="float: left;position: relative;top: 10px;font-size: 16px;line-height: 30px;color: #333333;width: 80px;display: inline-block">登录密码:</div>
                            <div style="margin-left: 85px;height: 50px">
                                <input class="denglumima" type="text" value="'.(!empty($userdata) == true ? $userdata['password'] : "").'" style="font-size: 16px;background-color: #fafdff;border-radius: 4px;color: #666666;border: 1px solid #f3f9fd;margin-left: 10px;width: 100%;height: 40px;position: relative;top: 50%;transform: translateY(-50%);">
                            </div>
                        </div>
                        
                        <div style="clear: both"></div>
                        
                        <div style="width: 100%;height: 50px;margin-top: 10px">
                            <div style="float: left;position: relative;top: 10px;font-size: 16px;line-height: 30px;color: #333333;width: 80px;display: inline-block">所属角色:</div>
                            <div style="margin-left: 85px;height: 50px;position: relative">';

                            $str.='<span class="select_juese" style="margin-left: 10px;position: relative;top: 50%;transform: translateY(-50%);">'.(!empty($userdata) == true ? $userGroupInfo['role'] : "请选择").'</span>
                                <ul class="sub_juese">';
                                    //用户组
                                    $groupName = getUserGroupName();
                                    foreach ($groupName as $value){
                                        $str.='<li>'.$value['role'].'</li>';
                                    }
                                    $str.='</ul>
                                <style>
                                    .sub_juese{list-style-type:none;z-index: 1;}
                                    .select_juese{background-image: url("images/wode/sanjiao.png");background-repeat: no-repeat;background-position: 97%;font-size: 16px;color: #666;background-color: #fafdff;text-indent: 15px;border: 1px solid #f3f9fd;float: left;border-radius: 4px;width:100%;height:40px;cursor:pointer;line-height:40px;}
                                    .sub_juese{font-size: 16px;position: absolute;top: 45px;left: 10px;color:#e5e5e5;width:100%;background:#fafdff;border:1px solid #f3f9fd;display: none;}
                                    .sub_juese li{color: #666666;height:40px;text-align: center;line-height:40px;cursor:pointer;border-bottom:1px solid #f3f9fd;}
                                    .sub_juese li.hover{background:#8b8b8b;}
                                </style>
                                <script type="text/javascript">
                                    $(".select_juese").click(function(event) {
                                        $(".sub_juese").css("display") == "none" ? $(".sub_juese").css("display","block") : $(".sub_juese").css("display","none");
                                    });
                                    
                                    $(".sub_juese li").each(function() {
                                        $(this).mouseover(function() {
                                            $(this).css("background-color","#429de3");
                                        });
                                        
                                        $(this).mouseout(function() {
                                            $(this).css("background-color","#fff");
                                        });
                                        
                                        $(this).click(function() {
                                            $(".select_juese").html($(this).text());
                                            $(".sub_juese").css("display","none");
                                        });
                                    });
                                </script>';

                            $str.='</div>
                        </div>
                        
                        <div style="height: 50px;margin-top: 10px">
                            <script>
                                function isChecked(obj) {
                                    var tmp = obj;
                                    var id = $(tmp).attr("id");
                                    if (id == "check1"){
                                        $(".check1").css("display","block");
                                        $(".check2").css("display","none");
                                    }else {
                                        $(".check2").css("display","block");
                                        $(".check1").css("display","none");
                                    }
                                }
                            </script>
                            <div style="width: 80px;height: 100%;float: left;line-height: 50px;">
                                是否启用:
                            </div>
                            <div style="margin-left: 90px;height: 100%;">';
                                    $str.='<div style="width: 25%;height: 100%;float: left">
                                                <div onclick="isChecked(this);" id="check1" style="cursor:pointer;position: relative;top: 50%;transform:translateY(-50%);display: inline-block">
                                                    <div style="position:absolute;top: 3px;width: 17px;height: 17px;background-image: url(images/xitong/yuan1.png)"></div>
                                                    <div class="check1" style="position:absolute;top: 3px;display: '.(!empty($userdata) == true ? ($userdata['enable'] === '1' ? "block":"none"):"block").';width: 17px;height: 17px;background-image: url(images/xitong/yuan2.png)"></div>
                                                    <span style="margin-left: 20px;font-size: 16px">启用</span>
                                                </div>
                                            </div>
                                            <div style="width: 25%;height: 100%;float: left">
                                                <div onclick="isChecked(this);" id="check2" style="cursor:pointer;position: relative;top: 50%;transform:translateY(-50%);display: inline-block">
                                                    <div style="position:absolute;top: 3px;width: 17px;height: 17px;background-image: url(images/xitong/yuan1.png)"></div>
                                                    <div class="check2" style="position:absolute;top: 3px;display: '.(!empty($userdata) == true ? ($userdata['enable'] === '2' ? "block":"none"):"none").';width: 17px;height: 17px;background-image: url(images/xitong/yuan2.png)"></div>
                                                    <span style="margin-left: 20px;font-size: 16px">停用</span>
                                                </div>
                                            </div>';

                                $str.='<div style="width: 25%;height: 100%;float: left">
                                </div>
                                <div style="width: 25%;height: 100%;float: left">
                                </div>
                            </div>
                        </div>
                    </div>
                    ';

        //党派
        $party_data = getPartylist();


        $str .= ' <!--个人信息-->
                    <div  style="font-size: 18px;color: #3e8ffe;margin-top: 0px">个人信息:</div>
                    <input type="hidden" class="id_flag" id="'.(!empty($userdata) == true ? $userdata['id'] : "").'">
                    <div style="width: 100%;height: 2px;margin-bottom: 10px;margin-top: 10px;background-color: #fff8ed"></div>
                    <div class="solide_box" style="width: 100%;padding-left: 20px;padding-right: 20px">
                        <div style="width: 47%;height: 50px;float: left">
                            <div style="float: left;position: relative;top: 10px;font-size: 16px;line-height: 30px;color: #333333;width: 80px;display: inline-block">姓名:</div>
                            <div style="margin-left: 85px;height: 50px">
                                <input class="xingming" type="text" value="'.(!empty($userdata) == true ? $userdata['realname'] : "").'" style="font-size: 16px;background-color: #fafdff;border-radius: 4px;color: #666666;border: 1px solid #f3f9fd;margin-left: 10px;width: 100%;height: 40px;position: relative;top: 50%;transform: translateY(-50%);">
                            </div>
                        </div>
                        
                        <div style="width: 47%;height: 50px;margin-left: 6%;float: left">
                            <div style="float: left;position: relative;top: 10px;font-size: 16px;line-height: 30px;color: #333333;width: 80px;display: inline-block">性别:</div>
                            <div style="margin-left: 85px;height: 50px;position: relative">';

                            $str.='<span class="select_sex" style="margin-left: 10px;position: relative;top: 50%;transform: translateY(-50%);">'.(!empty($userdata) == true ? $userdata['sex'] : "请选择").'</span>
                                    <ul class="sub_sex">
                                        <li>男</li>
                                        <li>女</li>
                                    </ul>
                                    <style>
                                        .sub_sex{list-style-type:none;z-index: 1;}
                                        .select_sex{background-image: url("images/wode/sanjiao.png");background-repeat: no-repeat;background-position: 97%;font-size: 16px;color: #666;background-color: #fafdff;text-indent: 15px;border: 1px solid #f3f9fd;float: left;border-radius: 4px;width:100%;height:40px;cursor:pointer;line-height:40px;}
                                        .sub_sex{font-size: 16px;position: absolute;top: 45px;left: 10px;color:#e5e5e5;width:100%;background:#fafdff;border:1px solid #f3f9fd;display: none;}
                                        .sub_sex li{color: #666666;height:40px;text-align: center;line-height:40px;cursor:pointer;border-bottom:1px solid #f3f9fd;}
                                        .sub_sex li.hover{background:#8b8b8b;}
                                    </style>
                                    <script type="text/javascript">
                                        $(".select_sex").click(function(event) {
                                            $(".sub_sex").css("display") == "none" ? $(".sub_sex").css("display","block") : $(".sub_sex").css("display","none");
                                        });
                                        
                                        $(".sub_sex li").each(function() {
                                            $(this).mouseover(function() {
                                                $(this).css("background-color","#429de3");
                                            });
                                            
                                            $(this).mouseout(function() {
                                                $(this).css("background-color","#fff");
                                            });
                                            
                                            $(this).click(function() {
                                                $(".select_sex").html($(this).text());
                                                $(".sub_sex").css("display","none");
                                            });
                                        });
                                    </script>';



                            $str.='</div>
                        </div>
                        
                        <div style="width: 47%;height: 50px;float: left;margin-top: 10px">
                            <div style="float: left;position: relative;top: 10px;font-size: 16px;line-height: 30px;color: #333333;width: 80px;display: inline-block">年龄:</div>
                            <div style="margin-left: 85px;height: 50px">
                                <input class="nianling" type="text" value="'.(!empty($userdata) == true ? $userdata['age'] : "").'" style="font-size: 16px;background-color: #fafdff;border-radius: 4px;color: #666666;border: 1px solid #f3f9fd;margin-left: 10px;width: 100%;height: 40px;position: relative;top: 50%;transform: translateY(-50%);">
                            </div>
                        </div>
                        
                        <div style="width: 47%;height: 50px;margin-left: 6%;float: left;margin-top: 10px">
                            <div style="float: left;position: relative;top: 10px;font-size: 16px;line-height: 30px;color: #333333;width: 80px;display: inline-block">届次:</div>
                            <div style="margin-left: 85px;height: 50px;position: relative">
                                <span class="select_jieci" style="margin-left: 10px;position: relative;top: 50%;transform: translateY(-50%);">'.(!empty($userdata) == true ? $userdata['session'] : "请选择").'</span>
                                <ul class="sub_jieci">
                                    <li>12</li>
                                    <li>13</li>
                                    <li>14</li>
                                    <li>15</li>
                                    <li>16</li>
                                    <li>17</li>
                                    <li>18</li>
                                    <li>19</li>
                                    <li>20</li>
                                </ul>
                                <style>
                                    .sub_jieci{list-style-type:none;z-index: 1;}
                                    .select_jieci{background-image: url("images/wode/sanjiao.png");background-repeat: no-repeat;background-position: 97%;font-size: 16px;color: #666;background-color: #fafdff;text-indent: 15px;border: 1px solid #f3f9fd;float: left;border-radius: 4px;width:100%;height:40px;cursor:pointer;line-height:40px;}
                                    .sub_jieci{font-size: 16px;position: absolute;top: 45px;left: 10px;color:#e5e5e5;width:100%;background:#fafdff;border:1px solid #f3f9fd;display: none;}
                                    .sub_jieci li{color: #666666;height:40px;text-align: center;line-height:40px;cursor:pointer;border-bottom:1px solid #f3f9fd;}
                                    .sub_jieci li.hover{background:#8b8b8b;}
                                </style>
                                <script type="text/javascript">
                                    $(".select_jieci").click(function(event) {
                                        $(".sub_jieci").css("display") == "none" ? $(".sub_jieci").css("display","block") : $(".sub_jieci").css("display","none");
                                    });
                                    
                                    $(".sub_jieci li").each(function() {
                                        $(this).mouseover(function() {
                                            $(this).css("background-color","#429de3");
                                        });
                                        
                                        $(this).mouseout(function() {
                                            $(this).css("background-color","#fff");
                                        });
                                        
                                        $(this).click(function() {
                                            $(".select_jieci").html($(this).text());
                                            $(".sub_jieci").css("display","none");
                                        });
                                    });
                                </script>
                            </div>
                        </div>';
                        

                        //党派
                        $str.='<div style="width: 47%;height: 50px;float: left;margin-top: 10px">
                                    <div style="float: left;position: relative;top: 10px;font-size: 16px;line-height: 30px;color: #333333;width: 80px;display: inline-block">党派团体:</div>
                                    <div style="margin-left: 85px;height: 50px;position: relative">
                                        <span class="select_party" style="margin-left: 10px;position: relative;top: 50%;transform: translateY(-50%);">'.(!empty($userdata) == true ? $userdata['party'] : "请选择").'</span>
                                        <ul class="sub_party">';

                                        foreach ($party_data as $value){
                                            $str.= '<li>'.$value['partyname'].'</li>';
                                        }
                                    $str.='</ul>
                                        <style>
                                            .sub_party{list-style-type:none;z-index: 1;}
                                            .select_party{background-image: url("images/wode/sanjiao.png");background-repeat: no-repeat;background-position: 97%;font-size: 16px;color: #666;background-color: #fafdff;text-indent: 15px;border: 1px solid #f3f9fd;float: left;border-radius: 4px;width:100%;height:40px;cursor:pointer;line-height:40px;}
                                            .sub_party{font-size: 16px;position: absolute;top: 45px;left: 10px;color:#e5e5e5;width:100%;background:#fafdff;border:1px solid #f3f9fd;display: none;}
                                            .sub_party li{color: #666666;height:40px;text-align: center;line-height:40px;cursor:pointer;border-bottom:1px solid #f3f9fd;}
                                            .sub_party li.hover{background:#8b8b8b;}
                                        </style>
                                        <script type="text/javascript">
                                            $(".select_party").click(function(event) {
                                                $(".sub_party").css("display") == "none" ? $(".sub_party").css("display","block") : $(".sub_party").css("display","none");
                                            });
                                            
                                            $(".sub_party li").each(function() {
                                                $(this).mouseover(function() {
                                                    $(this).css("background-color","#429de3");
                                                });
                                                
                                                $(this).mouseout(function() {
                                                    $(this).css("background-color","#fff");
                                                });
                                                
                                                $(this).click(function() {
                                                    $(".select_party").html($(this).text());
                                                    $(".sub_party").css("display","none");
                                                });
                                            });
                                        </script>
                                    </div>
                               </div>';
                        
                        $str.='<div style="width: 47%;height: 50px;margin-left: 6%;float: left;margin-top: 10px">
                            <div style="float: left;position: relative;top: 10px;font-size: 16px;line-height: 30px;color: #333333;width: 80px;display: inline-block">工作单位:</div>
                            <div style="margin-left: 85px;height: 50px">
                                <input class="gongzuodanwei" type="text" value="'.(!empty($userdata) == true ? $userdata['work'] : "").'" style="font-size: 16px;background-color: #fafdff;border-radius: 4px;color: #666666;border: 1px solid #f3f9fd;margin-left: 10px;width: 100%;height: 40px;position: relative;top: 50%;transform: translateY(-50%);">
                            </div>
                        </div>
                        
                        <div style="width: 47%;height: 50px;float: left;margin-top: 10px">
                            <div style="float: left;position: relative;top: 10px;font-size: 16px;line-height: 30px;color: #333333;width: 80px;display: inline-block">手机号码:</div>
                            <div style="margin-left: 85px;height: 50px">
                                <input class="phone" type="text" value="'.(!empty($userdata) == true ? $userdata['phone'] : "").'" style="font-size: 16px;background-color: #fafdff;border-radius: 4px;color: #666666;border: 1px solid #f3f9fd;margin-left: 10px;width: 100%;height: 40px;position: relative;top: 50%;transform: translateY(-50%);">
                            </div>
                        </div>
                        
                        <div style="width: 47%;height: 50px;margin-left: 6%;float: left;margin-top: 10px">
                            <div style="float: left;position: relative;top: 10px;font-size: 16px;line-height: 30px;color: #333333;width: 80px;display: inline-block">街道工委:</div>
                            <div style="margin-left: 85px;height: 50px">
                                <input class="jiedaogongwei" type="text" value="'.(!empty($userdata) == true ? $userdata['street'] : "").'" style="font-size: 16px;background-color: #fafdff;border-radius: 4px;color: #666666;border: 1px solid #f3f9fd;margin-left: 10px;width: 100%;height: 40px;position: relative;top: 50%;transform: translateY(-50%);">
                            </div>
                        </div>
                    </div>
                </div>';


        $str.='
                <div style="height: 78px;width: 100%;position: relative;background-color: #f0f6ff;border-bottom-left-radius: 4px;border-bottom-right-radius: 4px">
                    <div style=";display: inline-block;position: absolute;left: 50%;top: 18%;transform: translateX(-50%);">
                        <button '.(!empty($userdata) == true ? "onclick='updateUser();'" : "onclick='createUser();'").' style="background-color: #3e8ffe;width: 210px;height: 48px;border-radius: 10px;color: white;font-size: 16px;">保存</button>
                    </div>
                </div>
            </div>';
        //createUser();
        return $str;
    }
}